import 'package:flower_flutter/provider/provider_state.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class StatePage_1 extends StatefulWidget {
  @override
  StatePage_1State createState() => new StatePage_1State();
}

class StatePage_1State extends State<StatePage_1> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text('')),
        body: Consumer(builder: (context, ProviderState state, _) {
          return Center(
            child: GestureDetector(
                child: Text('点击'),
                onTap: () {
                  state.setAge(20);
                }),
          );
        }));
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }

  @override
  void didUpdateWidget(StatePage_1 oldWidget) {
    // TODO: implement didUpdateWidget
    super.didUpdateWidget(oldWidget);
  }

  @override
  void didChangeDependencies() {
    // TODO: implement didChangeDependencies
    super.didChangeDependencies();
  }
}
